/********************************************************************************
 *      Copyright:  (C) 2022 Nikel
 *                  All rights reserved.
 *
 *       Filename:  json.h
 *    Description:  This head file 
 *
 *        Version:  1.0.0(28/04/22)
 *         Author:  zhouyanlin <www.zhouyanlin1222@qq.com>
 *      ChangeLog:  1, Release initial version on "28/04/22 14:25:44"
 *                 
 ********************************************************************************/

#ifndef  _JSON_H_
#define  _JSON_H_

#include <stdio.h>
#include <cJSON.h>

#include "msqt.h"
#include "times.h"
#include "log.h"

typedef struct
{
	    char        		*str;
		char        		*key;
		const char        	*id;
		const char        	*version;
		const char       	*method;
		float       		payload;
		int         		rv;
		cJSON       		*cjson_head;
		cJSON       		*item;

} pack_ctx_t;

int pack_in_json(pack_ctx_t *json, time_ctx_t *t, mqtt_ctx_t mqtt_ctx);

#endif   /* ----- #ifndef _JSON_H_  ----- */
